import greenfoot.World;
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class LegoNxtWorld here.
 * 
 * @author (kos) 
 * @version (jan2011)
 */
public class LegoNxtWorld extends World {

	final LegoMotorA motorA;
	final LegoMotorB motorB;
	final LegoMotorC motorC;
	final LegoUltraSnd ultrasnd;

	/**
	 * Constructor for objects of class LegoWorld.
	 * 
	 */
	public LegoNxtWorld() {
		// Create a new world with 500x300 cells with a cell size of 1x1 pixels.
		super(500, 300, 1);
		setBackground("images/techBackGround.png");
		ultrasnd = new LegoUltraSnd();
		motorA = new LegoMotorA();
		motorB = new LegoMotorB();
		motorC = new LegoMotorC();
		Slider slider1 = new Slider();

		addObject(motorA, 200, 200);
		addObject(motorB, 270, 200);
		addObject(motorC, 340, 200);
		addObject(ultrasnd, 100, 100);
		addObject(slider1, 110, 10);

	}

	public void stopped() { // stopped() method redefinition. executed when scenario is stopped, 
		motorA.stop();
		super.stopped(); //call the original stopped() method
	}
}
